﻿//#ifndef MAPPLICATION_H
//#define MAPPLICATION_H
#pragma once
#include <QObject>
#include <QApplication>
#include <QCoreApplication>
#include <QGuiApplication>
//#include <qtqml>
#include <QTranslator>
#include <QDebug>
#include <QQuickView>
#include "MEngine.h"
#include "../ErrorDefine/MAppError.h"

#ifndef PRINT_LOG
    #define MY_LOG 01
#endif

#if MY_LOG
    #define M_LOG                       qDebug() << "[ ### SERVER DEBUG--->] [" << __FUNCTION__ << ":" << __LINE__ << "]"
    #define M_LOG_PARAM(str,param)      qDebug() << "[ ### SERVER DEBUG--->] [" << __FUNCTION__ << ":" << __LINE__ << "]" << str << param
#else
    #define M_LOG
    #define M_LOG_PARAM(str,param)
#endif


class MApplication: public
#ifdef __MOBILE__
    QGuiApplication // Native Qml based application
#else
    QApplication
#endif
{
    Q_OBJECT
public:
    MApplication(int &argc, char* argv[], bool unitTesting);
    void _initCommon(void);
    void _initEngine();
    int  _loadQMLFile();
    void _initViewer();
public:
    MEngine * pEngine;
    QQuickView *viewer;

    int _loadQMLFile(bool sta);
public slots:

private:
    bool _runningUnitTests;

};

//#endif // MAPPLICATION_H
